package com.chensi.model;

import java.io.Serializable;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

/**
 * 实体user
 * @author Chason
 * @version 2015-12-30 下午3:35:46
 */
@SuppressWarnings("serial")
public class User implements Serializable{

	//实体类的属性和表的字段名称一一对应
    private Integer id;
    
    //hibernate-validate 依赖classmate,jboss-logging,validation-api
    @NotBlank(message="用户名不能为空")
    private String name;
    
    private Integer age;
    
    @NotNull(message="手机号不能为空")
//    @Pattern(regexp="^1[3|4|5|8][0-9]\\d{4,8}$",message="手机号格式有误")
    private Integer phone;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    
    public Integer getPhone()
	{
		return phone;
	}

	public void setPhone(Integer phone)
	{
		this.phone = phone;
	}

	public User()
	{
		super();
	}

	public User(Integer id, String name)
	{
		super();
		this.id = id;
		this.name = name;
	}

	
	public User(String name, Integer age)
	{
		super();
		this.name = name;
		this.age = age;
	}

	public User(String name, Integer age, Integer phone)
	{
		super();
		this.name = name;
		this.age = age;
		this.phone = phone;
	}

	@Override
	public String toString()
	{
		return "User [id=" + id + ", name=" + name + ", age=" + age + ", phone=" + phone + "]";
	}

}
